package com.gragra.structures.generators;
import com.gragra.structures.mainDatatypes.SimpleSentenceStructure;
import com.gragra.structures.SentenceStructure;
import com.gragra.structures.StructureGenerator;
/**
 * used to generate a sentencestructure from a string assuming that the string is a sequence of words separated by any type of whitespace character.
 * @author Christoph Teichmann
 * @version 0.1
 */
public class SplitOnWhiteSpaceCodeToIntegerGenerator implements
														StructureGenerator<SentenceStructure>
{
	/* (non-Javadoc)
	 * @see structures.StructureGenerator#make(java.lang.String)
	 */
	@Override
	public SentenceStructure make(final String input)
	{return new SimpleSentenceStructure(process(input).trim().split("\\s+"));}
	/**
	 * this method can be override to change the input string before it is split to form
	 * a sentence structure
	 * @param input
	 * @return
	 */
	protected String process(String input)
	{return input;}	
}